<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>推广明细</title>
    <link rel="stylesheet" href="/static/assets/libs/layui/css/layui.css" />
    <link rel="stylesheet" href="/static/assets/module/admin.css?v=312" />
    <style>
        .layui-form-item {
            margin-bottom: 25px;
        }

        label .layui-icon {
            font-size: 14px;
            color: #666;
        }
    </style>
</head>

<body>

    <!-- 正文开始 -->
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-body">
                <div>
                    <p>未结算金额: <span style="color: red;">{$info_0}</span> 元 (用户充值金额)</p>
                    <p>已结算金额: <span style="color: green;">{$info_1}</span> 元</p>
                    <hr>
                    <p><button type="button" class="layui-btn" onclick="jiesuan()">结算</button></p>
                    <hr>
                    <p>请按照比例计算后并发送佣金！再结算！<br>如:10元*0.2(20%)=2元(他得到的佣金)</p>
                </div>
            </div>
        </div>
    </div>
    <!-- js部分 -->
    <script type="text/javascript" src="/static/assets/libs/layui/layui.js"></script>
    <script type="text/javascript" src="/static/assets/js/common.js?v=312"></script>
    <script>
        layui.use(['layer', 'jquery', 'table', 'dropdown', 'form'], function () {
            var $ = layui.jquery;
            var layer = layui.layer;
            var table = layui.table;
            var dropdown = layui.dropdown;
            var form = layui.form;
            // 渲染表格

            window.jiesuan = function () {
                layer.confirm('确定要结算吗？', {
                    btn: ['确定', '取消'] //按钮
                }, function () {
                    $.post("{:url('admin/invite/info')}", { id: {$uid} }, function (result) {
                        if(result.code == 0){
                            layer.msg('结算成功！',{time:1000,end:function(){
                                location.reload();
                            }});
                        }else{
                            layer.msg('结算失败');
                        }
                    });
                });
            }
        });

    </script>
</body>

</html>